The present invention relates generally to a network communication system, and more particularly to data block transferring method and apparatus which allocate storage for the data block based upon a received relative offset.
Communication between computers is a commonplace occurrence. As computer systems grow faster and more complex, communication between computers grows faster and more complex. As a result, the efficiency of computer communication may become a performance bottleneck and any extra time required in transferring a data packet will be reflected in the overall performance of the computer system.
Because efficient communication is important, improvements in the transmission of a packet are significant. One problem of efficient communication is efficiently generating an error detection code (e.g. a checksum) for a data packet. The problem of efficiently generating an error detection code stems from the typical placement of the error detection code in the header of a data packet and the nature of the error detection code calculation. The error detection code calculation typically requires all bytes of the data packet. As a result, whatever component of the computer system that generates the error detection code must scan all bytes of the data packet in order to generate the error detection code. Once the error detection code is calculated, the error detection code can be placed into the header of the data packet.
As a result of the above error detection code properties, prior art systems which utilized "in order" transmission of the data packet over the network (i.e. transmitting the header of the data packet first) did not calculate the error detection code as the data packet was being transmitted over the network because (1) the header portion included the error detection code, (2) the header portion was transmitted first, and (3) the error detection code was calculated from all bytes of the data packet. As a result, in these prior art systems the a packet including the error detection code was required to be completed prior to transmitting the packet across the network. In general, the prior art systems satisfied this requirement basically in one of two ways.
The first way was to have the processor of the computer system completely construct the packet including the error detection code in the memory of the computer system prior to transmitting the packet. The problem with this solution is that the processor was forced to calculate the error detection code for each packet transmitted over the network which during high speed communication can consume a substantial part of the processor's time.
The second way was to have the network card of the computer system generate the error detection code for the data packet. However, the prior art network cards either (a) had a substantial size buffer for storing the packet prior to transmission or (b) generated a substantial amount of traffic to the memory of the computer system. If the prior art network card had a large enough buffer, the network card would read the packet from memory into its buffer, generate an error detection code for the packet, store the error detection code for the packet in its buffer, and transfer the completed packet including the error detection code from its buffer to the network. The problem with this approach is that the network card was required to have a substantial amount of buffer memory in order to store the entire packet. This substantial amount of buffer memory added substantial costs to the network card.
However, if the prior art network card did not have a substantial size buffer, the network card would read the packet from the memory of the computer system, generate an error detection code for the packet, store the error detection code into the memory of the computer system, and then stream the completed packet including the error detection code from the memory of the computer system to the network. As should be appreciated this approach generated a substantial amount of traffic to the memory of the computer system due to the network card accessing the data packet twice. This substantial traffic to the memory of the computer system effected performance during high speed communications.
Another problem of efficient communication is efficient allocation of resources such a storage. For example, when transferring an IP packet over Fibre Channel, the IP packet is split into a sequence of frames and the sequence of frames is transmitted from a transmitting device such as a computer to a receiving device such as a computer or a printer. In the prior art, the receiving device would allocate a storage area for the IP packet using one of two allocation techniques. The first allocation technique required the receiving device to allocate a storage area having a storage capacity equal to the largest possible IP packet size (e.g. 64 kilobytes). Therefore, when receiving an IP packet smaller than the largest possible IP packet size. the receiving device wasted storage due to allocating too much storage for the IP packet.
The second allocation technique required the receiving device to allocate a storage area each time a frame was received. In particular, for each received Fibre Channel frame, the receiving device allocated a storage area having a storage capacity equal to the portion of the IP packet contained in the Fibre Channel frame. Each time the receiving device allocated a storage area, the receiving device suffered processing overhead associated with the storage allocation. Accordingly, while the second allocation technique enabled the receiving device to better utilize storage, the receiving device suffered more processing overhead due to the multiple memory allocations required for each IP packet.
Therefore, what is needed is a method and apparatus for transferring a packet which allows a receiving device to better allocate storage without incurring substantial processing overhead.